As typified by a digital VTR (Video Tape Recorder), a data recording and reproducing apparatus that records a digital video signal and a digital audio signal to a recording medium and reproducing them therefrom is known. Since the data amount of a digital video signal is huge, it is normally compression-encoded according to a predetermined system and recorded on a recording medium. In recent years, the MPEG2 (Moving Picture Experts Group 2) system is known as a standard compression-encoding system.
In the MPEG2, data obtained by a prediction encoding method using a motion detection and a DCT (Discrete Cosine Transform) method is quantized and compression-encoded. In addition, by a variable length code encoding method, the compression efficiency is improved.
Each frame is compression-encoded by the DCT method. For example, an input digital video signal is block-segmented in a predetermined size. A DCT-calculation is performed for each segmented block. Coefficients obtained by the DCT-calculation are quantized. A quantized representative value is encoded with a variable length code and then compression-encoded. The rounding accuracy of coefficients quantized in the DCT-calculation has been predetermined. The rounding accuracy is for example the four cut and five count method (which is a rounding method for counting five and over as a unit and cutting away the rest), the five cut and six count method (which is a rounding method for counting six and over as a unit and cutting away the rest), or the rounding off method.
When coefficients are quantized with a fixed rounding accuracy, it is difficult to effectively compression-encode both a picture that can be easily quantized and a picture that cannot be easily quantized.
On the other hand, as one example of a method for dynamically varying the rounding accuracy of coefficients that are quantized, for example Japanese Patent Laid-Open Publication No. HEI 10-304362 discloses a method for varying the rounding accuracy of coefficients that are quantized corresponding to the size of the amplitude thereof. As another example, Japanese Patent Laid-Open Publication No. HEI 10-304363 discloses a method for varying the rounding accuracy of DCT coefficients that are quantized corresponding to a frequency component thereof. However, by those methods, it is inevitable that an encoding noise causes the picture quality to deteriorate.
Thus, an object of the present invention is to provide a quantizing apparatus, a quantizing method, a quantizing program, and a recording method that allow the rounding accuracy of coefficients that are quantized to be dynamically varied with a simple structure, an encoding noise to be effectively suppressed, a picture quality to be prevented from being deteriorated.